//
//  HotTripTableViewCell.m
//  LT
//
//  Created by dllo on 16/5/16.
//  Copyright © 2016年 dllo. All rights reserved.
//

#import "HotTripTableViewCell.h"
#import "UIImageView+WebCache.h"
#define WIDTH self.view.frame.size.width




@implementation HotTripTableViewCell

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self createSubViews];
    }
    return self;
}

//安排"热门游记"界面的坐标
-(void)createSubViews{
//图片坐标
    self.photoImage = [[UIImageView alloc]init];
    self.photoImage.frame = CGRectMake(5* WIDTHCELL, 5* WIDTHCELL, 105* WIDTHCELL, 90* WIDTHCELL);
   // self.photoImage.backgroundColor = [UIColor whiteColor];
    [self.contentView addSubview:self.photoImage];
    //titleLabel坐标
    self.titleLabel = [[UILabel alloc]initWithFrame:CGRectMake(120* WIDTHCELL, 5* WIDTHCELL, 285* WIDTHCELL, 46* WIDTHCELL)];
    //self.titleLabel.backgroundColor = [UIColor whiteColor];
    self.titleLabel.font = [UIFont systemFontOfSize:16];
    self.titleLabel.numberOfLines = 2;
    [self.contentView addSubview:self.titleLabel];
    //userName坐标
    self.usernameLabel = [[UILabel alloc]initWithFrame:CGRectMake(120* WIDTHCELL, 52* WIDTHCELL, 100* WIDTHCELL, 20* WIDTHCELL)];
    
    //self.usernameLabel.backgroundColor = [UIColor whiteColor];
    [self.contentView addSubview:self.usernameLabel];
    //viewsLabel
    self.viewsLabel = [[UILabel alloc]initWithFrame:CGRectMake(120* WIDTHCELL, 73* WIDTHCELL, 50* WIDTHCELL, 20* WIDTHCELL)];
    //self.viewsLabel.backgroundColor = [UIColor whiteColor];
    [self.contentView addSubview:self.viewsLabel];
    //replyLabel
    self.replysLabel = [[UILabel alloc]initWithFrame:CGRectMake(175* WIDTHCELL, 73* WIDTHCELL, 50* WIDTHCELL, 20* WIDTHCELL)];
    //self.replysLabel.backgroundColor = [UIColor whiteColor];
    [self.contentView addSubview:self.replysLabel];
    
    //lineLabel
    self.lineLabel = [[UILabel alloc]initWithFrame:CGRectMake(0* WIDTHCELL, 101* WIDTHCELL,415* WIDTHCELL, 0.5* WIDTHCELL)];
    //self.lineLabel.backgroundColor = [UIColor blackColor];
    [self.contentView addSubview:self.lineLabel];
    
    

}


//赋值
-(void)setHotModel:(ThirdLModel *)hotModel{
    _hotModel = hotModel;
    [self.photoImage sd_setImageWithURL:[NSURL URLWithString:_hotModel.photo] placeholderImage:[UIImage imageNamed:@"LETU"]];
    self.titleLabel.text = _hotModel.title;
    self.usernameLabel.text = _hotModel.username;
    self.replysLabel.text = _hotModel.replys;//吧数字转化成字符串
    self.viewsLabel.text = [_hotModel.views stringValue];



}



//这里需要重新布局吗

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
